
// app加载状态
const AppLoading={
    state(){
        return{
            nowStatus:'loading'
        }
    },
    mutations:{
        setNowStatus(state,status){
            state.nowStatus = status
        }
    },
    actions:{
        setNowStatus({commit},status){
            commit('setNowStatus',status)
        }
    },
    getters:{
        getNowStatus(state){
            return state.nowStatus
        }
    }
}

//购物车物品数量，用于显示购物车上的小红点
const Commodity= {
    state(){
        return{
            commodityCount:0    
        }
    },
    mutations:{
        setCommodityCount(state,count){
            state.commodityCount = count
        }
    },
    actions:{
        setCommodityCount({commit},count){
            commit('setCommodityCount',count)
        }
    },
    getters:{
        getCommodityCount(state){
            return state.commodityCount
        }
    }
}

export {AppLoading,Commodity}